import { getAction, postAction, deleteAction } from '@/api/baseAPI'

/** 文章分类 */
// 查询文章分类树
export const apiQueryArticleVarietyTree = params => getAction('/back/article-variety/tree', params)
// 保存文章分类信息
export const apiSaveArticleVariety = params => postAction('/back/article-variety/save', params)
// 更新文章分类信息
export const apiUpdateArticleVariety = (id, params) => postAction('/back/article-variety/update/' + id, params)
// 删除文章分类信息
export const apiDelArticleVariety = id => postAction('/back/article-variety/del/' + id)

/** 文章信息 */
// 分页查询文章信息
export const apiQueryArticleList = params => getAction('/back/article/page', params)
// 新增文章信息
export const apiSaveArticle = params => postAction('/back/article/save', params)
// 更新文章信息
export const apiUpdateArticle = (id, params) => postAction('/back/article/update/' + id, params)
// 上架文章信息
export const apiEnableArticle = id => postAction('/back/article/enable/' + id)
// 下架文章信息
export const apiDisableArticle = id => postAction('/back/article/disable/' + id)
// 删除文章信息
export const apiDelArticle = id => postAction('/back/article/delete/' + id)
// 按id查询文章信息
export const apiQueryArticleById = id => getAction('/back/article/' + id)

/** 案例管理 */
// 分页查询案例信息
export const apiQueryCaseInfoList = params => getAction('/back/case-info/page', params)
// 新增案例信息
export const apiSaveCaseInfo = params => postAction('/back/case-info/save', params)
// 更新案例信息
export const apiUpdateCaseInfo = (id, params) => postAction('/back/case-info/update/' + id, params)
// 上架案例信息
export const apiEnableCaseInfo = id => postAction('/back/case-info/enable/' + id)
// 下架案例信息
export const apiDisableCaseInfo = id => postAction('/back/case-info/disable/' + id)
// 删除案例
export const apiDeleteCaseInfo = id => postAction('/back/case-info/del/' + id)
// 按id查询案例信息
export const apiQueryCaseInfoById = id => getAction('/back/case-info/' + id)

/** 案例评论 */
// 分页查询案例评论
export const apiQueryCaseCommentList = params => getAction('/back/case-comment/page', params)
// 删除案例评论
export const apiDelCaseComment = id => deleteAction('/back/case-comment/' + id)
// 隐藏案例信息
export const apiDisableCaseComment = id => postAction('/back/case-comment/disable/' + id)
